package com.springcloud.authentication.modules.entity;


import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Transient;
import org.hibernate.annotations.GenericGenerator;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 角色表
 * @author Administrator
 *
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Entity
@Table(name="sys_role")//对应数据库表名
@GenericGenerator(name = "jpa-uuid", strategy = "uuid")
public class SysRole {
	
	
	@Id
	@GeneratedValue(generator = "jpa-uuid")
	@Column(length = 32)
	private String id; //主键id
	
	@Column
	private String name; //角色名称
	
	@Transient
	private List<SysPermission> sysPermission; //权限
	
//	@ManyToOne
//  @JoinColumn(name = "id",insertable = false, updatable = false)
//	private SysUser sysUser;
}
